using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using WebControls;
using EntityLayer;
using InfraStructureLayer;
using BusinessLayer;

public partial class Admin_ChangePassword : SFPage
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void btnChange_Click(object sender, EventArgs e)
    {
        this.Validate();
        if (this.HasErrors)
        {
            MessageBoxShow(this);
            return;
        }
        if (txtNewPassword1.Text != txtNewPassword2.Text)
        {
            MessageBoxShow(StaticMethods.GetErrorMessageMultilanguageString(26, new object[] { }));
        }
        entUsers insEntUsers = new entUsers();
        insEntUsers.UserId = CurrentContext.UserId.Value;
        insEntUsers.UserPassword = txtOldPassword.Text;
        busUsers insBusUsers = new busUsers();
        insBusUsers.ChangeUserPassword(insEntUsers, txtNewPassword1.Text);
        if (insBusUsers.HasErrors)
        {
            MessageBoxShow(insBusUsers);
            return;
        }
    }
}
